<!-- head -->
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a>主页</a></li>
            <li><a>代理商管理/代理商活动</a></li>
            <li class="active"><strong>代理商活动配置</strong></li>
        </ol>
    </div>
</div>

<!-- content-->
<div class="wrapper wrapper-content animated fadeIn" ng-controller="agentActivitySaveCtrl">
    <form class="form-horizontal" id="form1" name="horizontalCard">
        <div class="form-group">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="ibox-title">
                        <h5>代理商活动基础配置</h5>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-1 control-label"><i class="red_req">*</i>活动名称:</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" ng-disabled="isDetail" name="actName" required ng-model="addInfo.actName" placeholder="活动名称不超过20个字" maxlength="20">
                                <div class="req_mesg" ng-show="horizontalCard.actName.$dirty && horizontalCard.actName.$invalid">
                                    <span ng-show="horizontalCard.actName.$error.required">活动名称不能为空</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label"><i class="red_req">*</i>活动时间:</label>
                            <div class="col-sm-5">
                                <input id="d5231" class="form-control" type="datetime" ng-disabled="isDetail" ng-model="addInfo.actBeginTime" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="var d5232=$dp.$('d5232');WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked:function(){d5232.focus();},maxDate:'#F{$dp.$D(\'d5232\')}'})"/>
                                ~
                                <input id="d5232" class="form-control" type="datetime" ng-disabled="isDetail" ng-model="addInfo.actEndTime" onchange=""  style="width:auto;display:inline-block;"
                                       onFocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'d5231\')}'})"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label"><i class="red_req">*</i>活动规则:</label>
                            <div class="col-lg-7" ng-if="!isDetail">
                                <summernote type="text" config="summeroptions" id="summernote" class="form-control" name="actRule" required ng-model="addInfo.actRule" on-image-upload="imageUploadALL(files)" editable="editable" editor="editor" >
                                </summernote>
                                <div class="req_mesg" ng-show="horizontalCard.actRule.$dirty && horizontalCard.actRule.$invalid">
                                    <span ng-show="horizontalCard.actRule.$error.required">活动规则不能为空</span>
                                </div>
                            </div>
                            <div class="col-lg-7" ng-if="isDetail" >
                                <div  style="height: 250px;overflow：hidden;overflow-y:scroll" class="form-control" ng-bind-html="addInfo.actRule | trustHtml" readonly>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label"><i class="red_req">*</i>活动对象:</label>
                            <div class="col-sm-2">
                                <select class="form-control" name="agent" disabled ng-model="agent" ng-options="x.value as x.text for x in agentSelect"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">活动备注:</label>
                            <div class="col-sm-7">
                                <textarea class="form-control" rows="4" cols="15" ng-disabled="isDetail" ng-model="addInfo.actDesc" placeholder="活动备注不超过200个字" maxlength="200"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-title">
                        <h5>活动类型设置</h5>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-1 control-label"></label>
                            <div class="col-sm-8">
                                <div class="gridStyle" style="height: 200px" ui-grid="userGrid"></div>
                            </div>
                        </div>
                    </div>
                    <div ng-if="isDetail">
                        <div class="ibox-title">
                            <h5>活动地址</h5>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">链接地址:</label>
                            <div class="col-sm-10 checkbox" style="margin-left: 7px;" ng-bind="addInfo.actLink"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-12 bgff">
                <div class="col-sm-12">
                    <div class="col-lg-3"></div>
                    <div class="col-sm-6">
                        <button class="btn btn-primary btn-mr20" type="button" ng-show="!isDetail" ng-click="saveInfo()" ng-disabled="horizontalCard.$invalid || submitting">提交</button>
                        <a class="btn btn-primary4" ng-click="toBack()"  >返回</a>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>